package com.gitee.dubboOps.param;

import java.util.Arrays;
import java.util.Map;

public class ServiceInvokeParam {

    /**
     * 需要调用的服务所属的环境标识
     */
    private String envType;

    /**
     * 需要调用的服务名
     */
    private String dataId;

    /**
     * 需要调用的服务组别
     */
    private String group;

    /**
     * 需要调用的方法签名
     */
    private String methodSignature;

    /**
     * 入参数组
     */
    private Object[] invokeArgs;

    public String getVersion() {
        return version;
    }

    public void setVersion(String version) {
        this.version = version;
    }

    /**
     * 调用的目标服务提供方
     */
    private String targetIp;

    /**
     * 自定义超时时间，毫秒
     */
    private int customTimeout;

    /**
     * 自定义provider version
     */
    private String version;

    /**
     * 是否执行内部类的自动转换，即将 com.taobao.Xxx.Xxx 的全类名转换成 com.taobao.Xxx$Xxx
     */
    private boolean convertInternalClass;

    /**
     * 调用的目标环境名称，仅在日常环境生效。当同时设置了 targetIp 时，以 targetIp 优先
     */
    private String targetProject;

    /**
     * 是否使用影子表，仅在预发 & 线上生效
     */
    private boolean useShadowDB;

    /**
     * 需要通过 RPCContext 传递的 attachments 数据
     */
    private Map<String, Object> attachments;

    public String getEnvType() {
        return envType;
    }

    public void setEnvType(String envType) {
        this.envType = envType;
    }

    public String getDataId() {
        return dataId;
    }

    public void setDataId(String dataId) {
        this.dataId = dataId;
    }

    public String getGroup() {
        return group;
    }

    public void setGroup(String group) {
        this.group = group;
    }

    public String getMethodSignature() {
        return methodSignature;
    }

    public void setMethodSignature(String methodSignature) {
        this.methodSignature = methodSignature;
    }

    public Object[] getInvokeArgs() {
        return invokeArgs;
    }

    public void setInvokeArgs(Object[] invokeArgs) {
        this.invokeArgs = invokeArgs;
    }

    public String getTargetIp() {
        return targetIp;
    }

    public void setTargetIp(String targetIp) {
        this.targetIp = targetIp;
    }

    public int getCustomTimeout() {
        return customTimeout;
    }

    public void setCustomTimeout(int customTimeout) {
        this.customTimeout = customTimeout;
    }

    public boolean isConvertInternalClass() {
        return convertInternalClass;
    }

    public void setConvertInternalClass(boolean convertInternalClass) {
        this.convertInternalClass = convertInternalClass;
    }

    public String getTargetProject() {
        return targetProject;
    }

    public void setTargetProject(String targetProject) {
        this.targetProject = targetProject;
    }

    public boolean isUseShadowDB() {
        return useShadowDB;
    }

    public void setUseShadowDB(boolean useShadowDB) {
        this.useShadowDB = useShadowDB;
    }

    public Map<String, Object> getAttachments() {
        return attachments;
    }

    public void setAttachments(Map<String, Object> attachments) {
        this.attachments = attachments;
    }

    @Override
    public String toString() {
        return "ServiceInvokeParam [envType=" + envType + ", dataId=" + dataId + ", group=" + group
            + ", methodSignature=" + methodSignature + ", invokeArgs=" + Arrays.toString(invokeArgs) + ", targetIp="
            + targetIp + ", customTimeout=" + customTimeout + ", convertInternalClass=" + convertInternalClass
            + ", targetProject=" + targetProject + ", useShadowDB=" + useShadowDB + ", attachments=" + attachments
            + "]";
    }

}

